package com.fastloan.safe.mgt.org.dao;


import com.fastloan.safe.mgt.org.model.CmuOrg;
import com.fastloan.safe.mgt.org.model.vo.OrgTreeVo;
import com.fastloan.safe.mgt.org.model.vo.OrgVo;
import com.kawins.base.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface CmuOrgMapper extends BaseMapper<CmuOrg> {

    /**
     * 获取机构分页列表
     *
     * @param map
     * @return
     */
    List<OrgVo> pageList(Map<String, Object> map);

    /**
     * 根据子机构获得顶级机构
     *
     * @param orgId
     * @param hasSelf
     * @param onlyTop
     * @return
     */
    List<CmuOrg> selectTopOrgBySon(@Param("orgId") String orgId, @Param("hasSelf") boolean hasSelf, @Param("onlyTop") boolean onlyTop);

    /**
     * /**
     * 根据顶级ID获得所有子集
     *
     * @param orgId
     * @param hasSelf
     * @return
     */
    List<OrgTreeVo> selectSonByTop(@Param("orgId") String orgId, @Param("hasSelf") boolean hasSelf);

    /**
     * 查询序列
     *
     * @return 序列
     */
    Long selectSequence();
}